//
//  TestTableViewCell.m
//  OffScreenDemo
//
//  Created by 梁立保 on 2019/6/13.
//  Copyright © 2019 梁立保. All rights reserved.
//

#import "TestTableViewCell.h"

@implementation TestTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self setup];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style
                     reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor grayColor];
        [self setup];
    }
    return self;
}

- (void)setup {
    [self addSubview:({
        // UIView: layer.cornerRadius                        // 无离屏渲染,有圆角
        // UIImageView: layer.cornerRadius                   // 无离屏渲染,有圆角
        // UILabel: layer.cornerRadius + layer.masksToBounds // 无离屏渲染,有圆角
        // UIButton: layer.cornerRadius                      // 无离屏渲染,有圆角
        UIView *tView = [[UIView alloc] initWithFrame:CGRectMake(100, 10, 100, 100)];
        tView.backgroundColor = [UIColor redColor];
        tView.layer.cornerRadius = 50;
        tView.layer.masksToBounds = YES;
        tView;
    })];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
